import os
from openai import OpenAI

client = OpenAI(
    api_key="sk-47fd418b4a8d4dffab040d3e9a282627",
    base_url="https://api.deepseek.com/v1"
)

try:
    response = client.chat.completions.create(
        model="deepseek-v3",
        messages=[{"role": "user", "content": "你好"}],
        max_tokens=10
    )
    print("API密钥验证成功！")
except Exception as e:
    print(f"API密钥验证失败: {str(e)}")